﻿using System;
using Extreme.SPFramework.DependencyInjection;
using Extreme.SPFramework.DomainModel;
using Extreme.SPFramework.Test.Entities;
using NUnit.Framework;

namespace Extreme.SPFramework.Test.Sharepoint
{
    [TestFixture]
    public class SPTestFixture
    {
        [Test]
        public void GetTrophyTourTest()
        {
            try
            {
                var repository = ServiceProvider.GetInstance<IRepository<CrazyTour>>();

                var crazyTour = new CrazyTour
                                     {
                                         Adults = 1,
                                         Employee = new PersonInfo(@"domain\login"),
                                         InvitationCode = "3q4yw45yw34",
                                         MailSent = false,
                                         PeopleCount = 5,
                                         Minors = 1
                                     };
                repository.SaveItem(crazyTour);
                for (int i = 0; i < 1000; i++)
                {
                    var newTrophyTour = repository.GetItem(crazyTour.ListId.Value);
                    newTrophyTour = repository.GetItem(crazyTour.UniqueId.Value);
                }
            }
            catch(Exception ex)
            {
                //throw;
            }
        }
    }
}